<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../bootstrap-5.1.3-dist/css/bootstrap.css">
    <script src="../bootstrap-5.1.3-dist/js/bootstrap.js"></script>
</head>

<body class="container">
    <h3 align="center">最大宽度和高度</h3>
    <div style="width: 400px;height: 300px;" class="border border-primary">
        <img src="1.jpg" class="mw-100 mh-100">
    </div>
</body>

</html>